import App from './App'

// 引入需要全局注册的组件（以uni-ui组件为例）
import uniPopup from '@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue'
import uniTransition from '@dcloudio/uni-ui/lib/uni-transition/uni-transition.vue'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'

// Vue2 全局注册组件
Vue.component('uni-popup', uniPopup)
Vue.component('uni-transition', uniTransition)

const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  
  // Vue3 全局注册组件
  app.component('uni-popup', uniPopup)
  app.component('uni-transition', uniTransition)
  
  return {
    app
  }
}
// #endif